package com.geekmvc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableJpaRepositories
@EnableCaching
@Slf4j
public class GeekMvcAppApplication {

	public static void main(String[] args) {

		SpringApplication.run(GeekMvcAppApplication.class, args);
		//xml注入Bean
//		ApplicationContext context = new ClassPathXmlApplicationContext("Coffee.xml");
//		Coffee coffee = context.getBean("coffeeXml", Coffee.class);
//		System.out.println(coffee);

	}

	/**
	 * 注入restTemplate
	 * @return
	 */
	@Bean
	public RestTemplate restTemplateApp(){
		return new RestTemplate();
	}

}
